package com.hnevc.caoliuye;

import java.util.Scanner;

public class Homework {
    public static String[] ParseInt(String[] str) {
        for (int i = 0; i < str.length; i++) {//只有符合手机号格式的才添加入数组
            if (str[i].matches("187[0-9]{8}")) {
                str[i] = str[i];
            } else {
                str[i] = null;
            }
        }
        return str;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入电话号码：");
        String str = sc.nextLine();
        String[] strArray = str.split("\\s+");
        strArray = ParseInt(strArray);
        int count = 0;
        for (int i = 0; i < strArray.length; i++) {
            if (strArray[i] != null) {
                count++;
            }
        }
        System.out.println(count);
    }
}